﻿Imports System.Data
Imports System.Data.OleDb
Imports System.Data.SqlClient

Public Class WebForm1
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim ConnectAndExecute As DBConnect = New DBConnect()
        'Create a connection variable
        Dim connection As SqlConnection
        'Create a command
        Dim selectCommand As New SqlCommand()
        'Create reader for SQL execute command
        Dim selectReader As SqlDataReader

        Try
            'Open Connection
            connection = ConnectAndExecute.getConnection()
            'Execute Command
            selectCommand.Connection = connection
            'Create Select Statement and store it in variable
            selectCommand.CommandText = "SELECT * FROM dbo.Player"
            selectReader = ConnectAndExecute.getDataReader("SELECT * FROM dbo.Player")
            'Read Output
            selectReader.Read()
            'ListBox1.Items.Add(selectReader("ParticipantID") & "," & selectReader("PlayerName"))

            'Label1.Text = "Success"
        Catch ex As Exception
            'Label1.Text = "Failure"
        End Try

    End Sub

End Class